<?php
    use yii\helpers\Html;
    use yii\helpers\Url;
    use yii\widgets\ActiveForm;
?>
<div class="wrapper wrapper-content">
    <div class="row">
        <div class="col-sm-12">

            <div class="ibox ">
                <div class="ibox-title">
                    <h5><?=Html::a('<i class="fa fa-angle-left"></i> 返回','javascript:history.go(-1);',['class'=>'btn btn-xs btn-white'])?> 添加角色</h5>
                </div>
                <div class="ibox-content">
                    <?= Html::beginForm('','post',['id' => 'login-form','class' => 'form-horizontal m-t pass-form'])?>
                        <div class="form-group">
                            <label class="col-sm-2 control-label"><span class="text-danger">*&nbsp;</span>角色名称：</label>
                            <div class="col-sm-2">
                                <?=Html::activeInput('text',$model, 'name',['class'=>'form-control']) ?>
                                <?=Html::error($model,'name',['class'=>'input_err'])?>
                            </div>
                        </div>
                        <? if(!empty($org)){?>
                            <div class="form-group">
                                <label class="col-sm-2 control-label"><span class="text-danger">&nbsp;</span>选择机构：</label>
                                <div class="col-sm-2">
                                    <?= Html::dropDownList('AdminRoleModel[organization_id]', $model->organization_id?:'', ['0'=>'请选择机构']+$org,['class'=>'form-control class_id']) ?>
                                    <?=Html::error($model,'organization_id',['class'=>'input_err'])?>
                                </div>
                            </div>
                        <? }?>
                        <div class="form-group">
                            <div class="col-sm-4 col-sm-offset-2">
                                <?=Html::submitButton('保存',['class'=>'btn btn-primary col-md-offset-2'])?>
                                <?=Html::a('返回','javascript:history.go(-1);',['class'=>'btn btn-white'])?>
                            </div>
                        </div>
                    <?=Html::endForm() ?>
                </div>
            </div>
        </div>
    </div>